3 enum BGMKeys
{MenuTheme
= 0};
7 //Mix_OpenAudio(44100, MIX_DEFAULT_FORMAT, 2, 4000);
15 for (int i
= 0; i
< gameBGM
->size(); i
++) {
16 Mix_FreeMusic(gameBGM
->at(i
));
23 Mix_PlayMusic(gameBGM
->at(0), -1);
27 void BGM::playBGM(int bgmNumber
) {
28 Mix_PlayMusic(gameBGM
->at(bgmNumber
), -1);
29 currentBGM
= bgmNumber
;
31 //Similar to playBGM, but it fades in
32 void BGM::fadeInBGM(int bgmNumber
, int duration
) {
33 Mix_FadeInMusic(gameBGM
->at(currentBGM
), -1, duration
);
34 currentBGM
= bgmNumber
;
36 void BGM::fadeOutBGM(int duration
) {
37 Mix_FadeOutMusic(duration
);
40 void BGM::setVolume(int level
) {
41 std::cout
<< Mix_VolumeMusic(MIX_MAX_VOLUME
* level
/ 4) << " - BGM Volume Level\n";